<template>
  <div>
    <b>Son1</b> -from parent money: '{{ money }}'
    <!-- <b>Son1</b> -from parent money: '{{ value }}' -->
    <!-- 1.方式一-->
    <!-- <button @click="changeMoney(200)">changeMoney</button> -->
    <!-- 2.方式二 -->
    <!-- <button @click="$emit('click', 100)">changeMoney</button> -->
    <!-- 3.方式三 -->
    <!-- <button @click="$emit('input', 300)">changeMoney</button> -->
    <!-- <button @click="$emit('change', 300)">changeMoney</button> -->
    <!-- 4. 方式四 -->
    <button @click="$emit('update:money', 300)">changeMoney</button>
  </div>
</template>

<script>
export default {
  name: 'Son1',
  model: {
    prop: 'money',
    event: 'change'
  },
  props: {
    money: {
      type: Number,
      default: 1000
    },
    changeMoney: {
      type: Function
    },
    value: {
      type: Number,
      default: 1000
    }
  }
}
</script>

<style lang="scss" scoped></style>
